import json

# 读取SMS_3-input.json
with open('SMS_3-input.json', 'r', encoding='utf-8') as f:
    sms_data = json.load(f)

# 转换SMS_3
sms_output = {
    'initialState': {
        'WDP': sms_data['WDP'],
        'WUP': sms_data['WUP'],
        'WLP': sms_data['WLP'],
        'SP': sms_data['SP'],
        'FRP': sms_data['FRP']
    },
    'parameters': {
        'WUMx': sms_data['WUMx'],
        'B': sms_data['B'],
        'C': sms_data['C'],
        'IM': sms_data['IM'],
        'WLMx': sms_data['WLMx'],
        'K': sms_data['K'],
        'EX': sms_data['EX'],
        'WM': sms_data['WM'],
        'SM': sms_data['SM'],
        'KG': sms_data['KG'],
        'KI': sms_data['KI'],
        'clen': sms_data['clen'],
        'monthlyPET': sms_data['monthlyPET']
    },
    'rainfallSeries': sms_data['rainfallSeries']
}

# 保存
with open('SMS_3-input.json', 'w', encoding='utf-8') as f:
    json.dump(sms_output, f, indent=2, ensure_ascii=False)

print('✅ SMS_3-input.json converted successfully!')

